show first run again#5122
Conversation
|
/backport to stable 3.10 |
|
IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/12173-IT |
ezaquarii
left a comment
There was a problem hiding this comment.
I believe, the safest approach with minimal regression risk would be to disable this particular code path in FirstRunActivity using a if and boolean flag:
class BaseActivity ... {
protected enableAccountHandling = true;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (enableAccountHandling) {
Account account = accountManager.getCurrentAccount();
setAccount(account, false);
}
}
...
if (newAccount == null) {
/// no account available: force account creation
createAccount(true);
if (enableAccountHandling) {
finish();
}
} else {
currentAccount = newAccount;
}
...
}
and in FirstRunActivity:
public void onCreate(...) {
enableAccountHandling = false;
super.onCreate();
...
}
| } | ||
|
|
||
| @Override | ||
| protected void onCreate(@Nullable Bundle savedInstanceState) { |
There was a problem hiding this comment.
This part was moved in this commit:
If you loot at it, you'll see that this code was previously in a wrong onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) method.
It was a bug that I introduced while refactoring Account-related code in BaseActivity, caused by IDE autocompletion - I simply typed wrong method signature while overriding onCreate. We didn't notice this as it works by accident simply becuase numerious calls to setAccount in derived activities.
| if (newAccount == null) { | ||
| /// no account available: force account creation | ||
| createAccount(true); | ||
| finish(); |
There was a problem hiding this comment.
This is what closes the FirstRunActivity.
Removing it wil break FileListActivity, causing empty file list after creating new account:
#5031 (comment)
There was a problem hiding this comment.
Yup, that's indeed what happens :-/ @tobiasKaminsky ?
|
/backport to stable-3.10 |
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
a4832ca to
87dae2e
Compare
|
Issues
======
+ Solved 1
See the complete overview on Codacy |
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12215.apk |
Codacy341Lint
SpotBugs (new)
SpotBugs (master)
|
Codecov Report
@@ Coverage Diff @@
## master #5122 +/- ##
============================================
+ Coverage 17.71% 17.74% +0.02%
Complexity 3 3
============================================
Files 392 392
Lines 33116 33120 +4
Branches 4651 4653 +2
============================================
+ Hits 5868 5878 +10
+ Misses 26292 26288 -4
+ Partials 956 954 -2
|
|
backport to stable-3.10 in #5147 |
ec515d0 [tx-robot] updated from transifex 422a61d Merge pull request #5136 from nextcloud/systemDefault 6e96e99 Merge pull request #5130 from nextcloud/createRichWorkspace b7a7772 Merge pull request #5122 from nextcloud/firstRun 603825e update screenshot c4d5e41 Merge pull request #5143 from nextcloud/background c6d89ed only allow rich workspace creation on >= Lollipop 87dae2e show first run again 9125285 manually increasing lint due to "autoMirrored" warning 4c10cf5 launcher: correct folder position according to AS 51fdf94 [tx-robot] updated from transifex e0b77f9 daily dev 20200110

Fix #5112
I also removed finish as it was not in there before.
Signed-off-by: tobiasKaminsky tobias@kaminsky.me